#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 55;

int n, m;
char s[N][N], t[N][N];
bool check(int x, int y) {
  rep(i, 1, m) rep(j, 1, m) {
    if (s[x + i - 1][y + j - 1] != t[i][j]) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) rep(j, 1, n) cin >> s[i][j];
  rep(i, 1, m) rep(j, 1, m) cin >> t[i][j];
  rep(i, 1, n + 1 - m) rep(j, 1, n + 1 - m) {
    if (check(i, j)) {
      cout << i << ' ' << j;
      return 0;
    }
  }
  return 0;
}